import org.junit.jupiter.api.Test;

import java.util.*;


public class Main {
    @Test
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            double m[][] = new double[n][9];
            for(int i=0;i<n;i++){
                for(int j=0;j<9;j++){
                    m[i][j] = scanner.nextDouble();
                }
            }
            double k[][] = new double[n][3];
            double b[][] = new double[n][3];
            int a=0;
            for(int i=0;i<n;i++){
                k[i][a] = (m[i][6] - m[i][4])/(m[i][5] - m[i][3]);
                k[i][a+1] = (m[i][8] - m[i][4])/(m[i][7] - m[i][3]);
                k[i][a+2] = (m[i][8] - m[i][6])/(m[i][7] - m[i][5]);

                b[i][a] = m[i][4] - k[i][a] * m[i][3];
                b[i][a+1] = m[i][8] - k[i][a+1] * m[i][7];
                b[i][a+2] = m[i][8] - k[i][a+2] * m[i][7];
            }
            double d[] = new double[3];
            for(int i=0;i<n;i++){
                d[0] = Math.abs(k[i][a]*m[i][0]-m[i][1]+b[i][a])/Math.sqrt(k[i][a]*k[i][a]+1);
                d[1] = Math.abs(k[i][a+1]*m[i][0]-m[i][1]+b[i][a+1])/Math.sqrt(k[i][a+1]*k[i][a+1]+1);
                d[2] = Math.abs(k[i][a+2]*m[i][0]-m[i][1]+b[i][a+2])/Math.sqrt(k[i][a+2]*k[i][a+2]+1);
                System.out.println(k[i][a]);
                System.out.println(k[i][a+1]);
                System.out.println(k[i][a+2]);
                System.out.println(b[i][a]);
                System.out.println(b[i][a+1]);
                System.out.println(b[i][a+2]);
                System.out.println(d[0]);
                System.out.println(d[1]);
                System.out.println(d[2]);
                if(d[0]<=m[i][2] || d[1]<=m[i][2] || d[2]<=m[i][2]){
                    System.out.println("炸到");
                }else{
                    System.out.println("没炸到");
                }
            }
        }
        scanner.close();
    }

}
